package com.xy.biz.ts.domain.enums;

import com.xy.lang.domain.KeyValue;
import com.xy.lang.enums.CodeEnum;

/**
 * @author Greekn Zhang
 * @date 2021/12/1 13:26
 * @description
 */
public enum TrainStatusEnum implements CodeEnum {
    NOT_TIME_YET(0, "时间未到"),
    FINISHED(1, "已完成"),
    UNFINISHED(2, "未完成");

    private int code;
    private String name;

    TrainStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public KeyValue<Integer, String> toKeyValue() {
        return new KeyValue<>(this.code, this.name);
    }
}
